﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Data;
using USTF.Media.MediaService;
using SUMO.MediaBrowser.Foundation;
using SUMO.MediaBrowser.ViewModel;

namespace SUMO.MediaBrowser.Converters
{
    public class MediaTooltipConverter : IValueConverter
    {

        #region IValueConverter Members

        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value is HierarchicalMediaItem)
            {
                var mediaItem = value as HierarchicalMediaItem;
                string tip = "";
                tip += "Name: " + mediaItem.CurrentItem.Properties.SafeGetValue("Title", "(no title)") + Environment.NewLine;
                tip += "Type: " + mediaItem.CurrentItem.Properties.SafeGetValue("ContentTypeAlias", "(no type)") + Environment.NewLine;
                // tip += "Date: " + this.MediaCarrier.CreateDateTime + Environment.NewLine;


                //if (this.MediaCarrier.MediaProperties != null)
                //{
                //    foreach (mediaProperty p in this.MediaCarrier.MediaProperties)
                //    {
                //        tip += p.Key + ": " + p.PropertyValue + Environment.NewLine;
                //    }
                //}
                return tip;
            }
            else return "(unknown object)";
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
